package com.lei.Proxy.statics;

/**
 * @author: leiGer
 * @Date: 2021/01/14
 * @Time: 22:51
 */

//手机模型
public class DummyPhone implements Phone {
    //需要代理的业务对象
    private Phone realPhone;

    public Phone getRealPhone() {
        return realPhone;
    }

    public void setRealPhone(Phone realPhone) {
        this.realPhone = realPhone;
    }

    public DummyPhone(Phone realPhone) {
        this.realPhone = realPhone;
    }
    public DummyPhone(String brand,String series,String color) {
        realPhone = new MobilePhone(brand,series,color);
    }


    public DummyPhone() {
    }

    @Override
    public String getBrand() {
        return realPhone.getBrand();
    }

    @Override
    public String getSeries() {
        return realPhone.getSeries();
    }

    @Override
    public String getColor() {
        return realPhone.getColor();
    }

    //重写call方法
    @Override
    public void call() {
        System.out.println(getColor() + "颜色的"+getBrand()+getSeries()+"手机无法拨打电话");
    }
}
